<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class CategorysModel extends Model{
    //根据category_id 获取 category 信息
    public function get($category_id){
        return $this->dbreader()->get($category_id);
    }

    //根据$category 获取 category 信息
    public function getCategoryInfoByName($category){
        return $this->dbreader()->getCategoryInfoByName($category);
    }


    //获取分类信息列表<带分页>
    public function getCategoryList($curr_page,$per_page,$filter = array()){
        return $this->dbreader()->getCategoryList($curr_page,$per_page,$filter);
    }

    //获取所有分类信息
    public function getCategorys($filter = array(),$flag = false){
        return $this->dbreader()->getCategorys($filter,$flag);
    }

    //添加分类信息
    public function addCategory($en_name, $zh_name){
        return $this->dbreader()->addCategory($en_name, $zh_name);
    }

    //删除分类信息
    public function delCategory($category_id){
        return $this->dbreader()->delCategory($category_id);
    }

    //更新分类信息
    public function updateCategory($id,$en_name = null,$zh_name = null){
        return $this->dbreader()->updateCategory($id,$en_name,$zh_name);
    }
}